/**
 * Copyright (C) 2010 Comba Telecom Systems Holdings Ltd. All rights reserved
 *
 * �������Ȩ�龩��ͨ��ϵͳ�ع����޹�˾���У����ܵ���صķ��ɱ�����
 * û�о����Ȩ�����ߵ�����ͬ�⣬
 * �κ�������˻���֯������κ���ʽ�����ļ����ļ��Ĳ��ִ�������������ҵ��;��
 *
 */
package com.xing.dao;

import java.util.List;
import java.util.Map;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projection;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.hibernate3.HibernateTemplate;

/**
 * �����ڴ�д�ϴ��๦���������֡�
 *
 * @version 
 * @author wushen  2011-7-4 ����03:45:08
 * 
 */
public interface BaseDao {

	public HibernateTemplate getHibernateTemplate();

	public JdbcTemplate getJdbcTemplate();
	
	
	public Map<String, Object> getListAndCount(String fetchParam, String hql,
			String orderBy, Integer page, Integer pageRow);
	
	public List<?> getList(String hql);
	
	public Map<String, Object> getListAndCount(String fetchParam, String hql,
			String orderBy, List<ParamModel> paramModelList, Integer page, Integer pageRow);
	
	public List<?> getList(String fetchParam, String hql,
			String orderBy, List<ParamModel> paramModelList);
	
	
	public List<Object[]> getListBySql(String sql, Object[] args, int[] argTypes);
	
	public List<?> getListByNameQuery(String queryName, List<ParamModel> paramModelList);
	
	
	public int executeByNameQuery(String queryName, List<ParamModel> paramModelList);
	
	
	public List<?> getDataByCriteria(Class<?> clazz, List<Criterion> criList,
			List<Order> ordList, List<Projection> proList);

	
	public void saveList(final List<?> list);
	
	/**
	 * 
	 * ִ�д洢��̷���
	 * 
	 * @author wushen 2011-7-11
	 * @param sql
	 * @param List<Integer> java.sql.Types
	 * @param List<Object> 
	 * @param autoCommit ����connection�ύ��ʽ��true:�Զ��ύ false:���Զ��ύ
	 */
	public void callProcedureWithoutResult(final String sql, final List<Integer> typesList, final List<Object> paramList, final boolean autoCommit);
	
	
	public int updateByHql(String hql);
	
	
	public int updateByHql(String hql, List<ParamModel> paramModelList);
	
}
